package com.test.p19memento.example01;

public class Client {


    public static void main(String[] args) {
        CareTaker taker = new CareTaker();

        Emp emp = new Emp("bcc",18,1000);

        System.out.println("第一次创建对象："+emp);

        //**备忘
        taker.setMemento(emp.memento());
        emp.setAge(48);
        emp.setName("abc");
        emp.setSalary(1);
        System.out.println("第二次打印对象："+emp);

        emp.recover(taker.getMemento());

        System.out.println("第三次打印对象："+emp);

    }

}
